<?php

namespace app\common\model;

use app\common\controller\Helper;
use think\Model;

class TieBa extends Model
{
    use Helper;

    protected $table = 'tie_ba';

    // 未审核
    const CHECK_NO = 0;
    // 审核通过
    const CHECK_PASS = 1;
    // 审核不通过
    const CHECK_REFUSE = 2;
    // 草稿
    const DRAFT = 1;
    // 不是草稿
    const DRAFT_NO = 0;
    // 点赞数、评论数大于999，则显示999+
    const MAX_NUM = 999;
    // 置顶
    const TOP = 1;
    const TOP_NO = 0;

    public static function attributes($attribute, $key = null)
    {
        $list = [
            'check_status' => [
                self::CHECK_NO => '未审核',
                self::CHECK_PASS => '已通过',
                self::CHECK_REFUSE => '不通过',
            ],
            'is_draft' => [
                self::DRAFT_NO => '否',
                self::DRAFT => '是',
            ],
            'is_top' => [
                self::TOP_NO => '否',
                self::TOP => '是',
            ]
        ];
        return self::attributeReturn($list, $attribute, $key);
    }
}